package model.interactionhandler;

import java.util.HashMap;
import java.util.List;
import model.entity.*;
import model.interactionHandlerInitializer.InteractionHandlerInitializer;


/**
 * This relationship class is used to map a basic entity to the interactions that can be
 * had with it. When creating an NPC an appropriate entry must be added here.
 * @author Vincent
 *
 */
public class BasicEntityHasInteractionInitializer {
	
	protected HashMap< BasicEntity, List<InteractionHandlerInitializer> > entToInteractions; 
	private static BasicEntityHasInteractionInitializer instance = null;
	
	private BasicEntityHasInteractionInitializer() {
		entToInteractions = new HashMap< BasicEntity, List<InteractionHandlerInitializer> >();
	}
	
	public static BasicEntityHasInteractionInitializer getInstance() {
		if( instance != null ) {
			return instance;
		}//else, instantiate it
		return instance = new BasicEntityHasInteractionInitializer();
	}
	
	public void addRelation(BasicEntity ent, List<InteractionHandlerInitializer> interactions){
		entToInteractions.put(ent, interactions);
	}
	
	public List<InteractionHandlerInitializer> getInteractions( BasicEntity ent){
		return entToInteractions.get(ent);
	}
	
}